import request from "@/utils/request";

//发送消息
export function sendMessageAPI(message) {
    return request({
        url:'/messages/add',
        method:'post',
        data:message
    })
}

//查询消息
export function queryMessageByUidAPI(uid) {
    return request({
        url:`/messages/receiver/${uid}`,
        method:'get',
    })
}

//更新消息
export function updateMessageAPI(message) {
    return request({
        url:`/messages/update/${message.mid}`,
        method:'put',
        data:message
    })
}

//删除消息
export function deleteMessageByMidAPI(mid) {
    return request({
        url:`/messages/delete/${mid}`,
        method:'delete',
    })
}